/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cn.eclass.servlet.front;

import cn.eclass.servlet.ActionFace;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletException;

/**
 *
 * @author fortruth
 */
public class Uadmin extends ActionFace {
	private void checkLogIn() throws ServletException, IOException {
		if(user != null) return;

		request.setAttribute("redirect", "uadmin");
		request.getRequestDispatcher(logInView).forward(request, response);
	}

    @Override
    public void doIndex() {
        try {
        	checkLogIn();
            request.getRequestDispatcher(view).forward(request, response);
        } catch (ServletException ex) {
            Logger.getLogger(Uadmin.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(Uadmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
